package com.whpost.api.controller.qyh;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.whpost.api.utils.ApiUtils;
import com.whpost.service.entity.tools.ResultInfo;
import com.whpost.service.service.cwqf.TCwqfKhjlKhServices;
import com.whpost.service.service.cwqf.TbCrmCustomerServices;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/qyh/kh")
public class KhkbApiController {

    @Resource
    private TbCrmCustomerServices tbCrmCustomerServices;

    @Resource
    private TCwqfKhjlKhServices tCwqfKhjlKhServices;

    /**
     * 客户看板
     * @return
     */
    @SaCheckLogin
    @RequestMapping(value ="/khkb")
    public ResultInfo khkb(@RequestBody Map<String, Object> map) {
        String loginId = ApiUtils.getLoginId();
        return tbCrmCustomerServices.khkb(loginId,map);
    }

    /**
     * 客户看板
     * @return
     */
    @SaCheckLogin
    @RequestMapping(value ="/khkb_mx")
    public ResultInfo khkbMx(@RequestBody Map<String, Object> map) {
        String loginId = ApiUtils.getLoginId();
        return tbCrmCustomerServices.khkbMx(loginId,map);
    }

    /**
     * 客户经理看板
     * @return
     */
    @SaCheckLogin
    @RequestMapping(value ="/khjlkb")
    public ResultInfo khjlkb(@RequestBody Map<String, Object> map) {
        String loginId = ApiUtils.getLoginId();
        return tbCrmCustomerServices.khjlkb(loginId,map);
    }

    /**
     * 已认领客户查询
     * @return
     */
    @SaCheckLogin
    @RequestMapping(value ="/khrl_query")
    public ResultInfo khrl_query(@RequestBody Map<String, Object> map) {
        String loginId = ApiUtils.getLoginId();
        return tCwqfKhjlKhServices.query(loginId,map);
    }

    /**
     * 未认领客户查询
     * @return
     */
    @SaCheckLogin
    @RequestMapping(value ="/khrl_query_no")
    public ResultInfo khrl_query_no(@RequestBody Map<String, Object> map) {
        String loginId = ApiUtils.getLoginId();
        return tCwqfKhjlKhServices.queryNo(loginId,map);
    }

    /**
     * 已认领客户查询
     * @return
     */
    @SaCheckLogin
    @RequestMapping(value ="/khrl_del")
    public ResultInfo khrl_del(@RequestBody Map<String, Object> map) {
        String loginId = ApiUtils.getLoginId();
        return tCwqfKhjlKhServices.del(loginId,map);
    }

    /**
     * 已认领客户查询
     * @return
     */
    @SaCheckLogin
    @RequestMapping(value ="/khrl_del_code")
    public ResultInfo khrl_del_code(@RequestBody Map<String, Object> map) {
        String loginId = ApiUtils.getLoginId();
        return tCwqfKhjlKhServices.delCode(loginId,map);
    }

    /**
     * 客户认领录入
     * @return
     */
    @SaCheckLogin
    @RequestMapping(value ="/khrl_add")
    public ResultInfo khrl_add(@RequestBody Map<String, Object> map) {
        String loginId = ApiUtils.getLoginId();
        return tCwqfKhjlKhServices.save(loginId,map);
    }

}
